<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8" />
	<title>登录</title>
	<meta content="width=device-width, initial-scale=1.0" name="viewport" />
	<link rel="shortcut icon" href="__STATICS__/images/title_logo.ico" type="image/x-icon" />
	<link rel="stylesheet" href="__STATICS__/css/base_login.css"/>
	<link href="__STATICS__/css/login2.css" rel="stylesheet" type="text/css"/>
	<script type="text/javascript" src="__STATICS__/js/sweet-alert.min.js"></script>
	<link rel="stylesheet" href="__STATICS__/css/sweet-alert.css"/>
</head>
<body>


	<div id="login_outer">
		<div id="login_wraper" class="clearfix">
			<!--<div id="login_wraper_top">
                <img src="__STATICS__/images/weihuoban_login.png" alt=""/>
            </div>
            <div id="login_wraper_left">
                <img src="__STATICS__/images/women_fucked.png" alt=""/>
            </div>-->

			<div id="login_wraper_left">
				<a href="javascript:void(0);" id="login_wraper_left_logo">
					<img src="__STATICS__/images/login_logo.png" alt=""/>
				</a>
				<div id="login_car">
					<img src="__STATICS__/images/login_car.png" alt=""/>
				</div>
			</div>

			<div id="login_wraper_right">
				<p id="login_content_head">中经汇通-后台管理系统</p>

				<form action="{:U('Login/checkLogin','','')}" method="post">
					<input placeholder="请输入用户名" type="text" name="username" id="username"/>
					<input placeholder="请输入密码" type="password" name="password" id="password"/>
					<button href="javascript:void(0)" type="submit" class="btn btn-primary btn-login">
						登&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;录
					</button>
				</form>
			</div>
		</div>
		<div id="login_outer_bottom">

		</div>
	</div>

<p id="login_bottom">
	<span> Copyright 2014 中经汇通 All Rights Reserved</span>
</p>
<script>
	var img_url = "__STATICS__/images";
	var login_url = "{:U('CNEPAdmin/Login/checkLogin')}";
</script>
<script src="__STATICS__/js/jquery1.11.1.min.js" type="text/javascript"></script>
<script src="__STATICS__/js/xw_load.js" type="text/javascript"></script>

<script>
	/*窗口高度*/


	$(function(){



		login_click();
		function login_click()
		{
			$('.btn-login').on('click',function(e) {
				e.preventDefault();
				var self = $(this);
				self.html('登录中...');
				self.unbind('click');


				var data = {};
				data.username = $.trim($('#username').val());
				data.password = $.trim($('#password').val());
				if($.trim(data.username) === '')
				{   login_click();
					self.html('登&nbsp;&nbsp;&nbsp;&nbsp;录');
					sweetAlert('','用户名不能为空','error');
					$('input').focusout();
				}
				else if($.trim(data.password) === ''){
					login_click();
					sweetAlert('','密码不能为空','error');
					self.html('登&nbsp;&nbsp;&nbsp;&nbsp;录');
					$('input').focusout();
				}
				else
				{
					xw_loader.start();

					$.ajax({
						url: login_url,
						type: "POST",
						data: data,
						cache: false
					}).done(function (msg) {

						xw_loader.end();


						if (msg.result === 1) {
							window.location.href = msg.url;
						}
						else
						{
							login_click();
							self.html('登&nbsp;&nbsp;&nbsp;&nbsp;录');
							sweetAlert('',msg.desc,'error');

						}
					}).error(function () {
						xw_loader.end();
						login_click();
						self.html('登&nbsp;&nbsp;&nbsp;&nbsp;录');
						sweetAlert('', '登录失败', 'error');
					});
				}

			});
		}


	});
</script>



</body>



</html>